﻿using Nacos.V2;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace NacosApp.NacosConf
{
    public class DemoConfigListener:IListener
    {
        public void ReceiveConfigInfo(string configInfo)
        {
            Console.WriteLine($"================收到配置变更信息了 ===》{configInfo}");
        }
    }
    public class DemoEventListener : IEventListener
    {
        public Task OnEvent(IEvent @event)
        {
            if (@event is Nacos.V2.Naming.Event.InstancesChangeEvent e)
            {
                Console.WriteLine($"==========收到服务变更事件=======》{Newtonsoft.Json.JsonConvert.SerializeObject(e)}");
            }

            return Task.CompletedTask;
        }
    }
}
